// index.js
Page({
    data: {
        msg: "hello 小程序",
        singers: ["林忆莲", "谭晶", "迪玛希", "杜丽莎", "狮子合唱团", "袁娅维"],
        counter: 0
    },
    add() {
        // vue  this.counter++
        // react  this.setState({counter:this.state.counter+1})
        // 小程序  this.setData({counter:this.data.counter +1 })

        this.setData({
            counter: this.data.counter + 1
        })
    },
    sub() {
        this.setData({
            counter: this.data.counter - 1
        })
    }
})